Trees | Indices | Toggle frames |
---|
AbstractImage --+ | AbstractImageSequence --+ | ImageGrid
An imaginary grid placed over an image allowing easy access to regular regions of that image.
The grid can be accessed either as a complete image, or as a sequence of images. The most useful applications are to access the grid as a TextureGrid:
image_grid = ImageGrid(...) texture_grid = image_grid.get_texture_sequence()
or as a Texture3D:
image_grid = ImageGrid(...) texture_3d = Texture3D.create_for_image_grid(image_grid)
__init__(self,
image,
rows,
columns,
item_width=None,
item_height=None,
row_padding=0,
column_padding=0)
Construct a grid for the given image.
|
|
Texture |
get_texture(self,
rectangle=False,
force_rectangle=False)
A Texture view of this image.
|
TextureSequence |
get_texture_sequence(self)
Get a TextureSequence.
|
__len__(self) | |
AbstractImage |
__getitem__(self,
index)
Retrieve a (list of) image.
|
Iterator |
__iter__(self)
Iterate over the images in sequence.
|
__repr__(self) (Inherited from pyglet.image.AbstractImage) | |
__setitem__(self,
slice,
image)
Replace one or more images in the sequence.
(Inherited from pyglet.image.AbstractImageSequence)
|
|
blit(self,
x,
y,
z=0)
Draw this image to the active framebuffers.
(Inherited from pyglet.image.AbstractImage)
|
|
blit_into(self,
source,
x,
y,
z)
Draw
(Inherited from pyglet.image.AbstractImage)
source on this image. |
|
blit_to_texture(self,
target,
level,
x,
y,
z=0)
Draw this image on the currently bound texture at
(Inherited from pyglet.image.AbstractImage)
target . |
|
Animation |
get_animation(self,
period,
loop=True)
Create an animation over this image sequence for the given constant
framerate.
(Inherited from pyglet.image.AbstractImageSequence)
|
ImageData |
get_image_data(self)
Get an ImageData view of this image.
(Inherited from pyglet.image.AbstractImage)
|
Texture |
get_mipmapped_texture(self)
Retrieve a Texture instance with all mipmap levels filled in.
(Inherited from pyglet.image.AbstractImage)
|
AbstractImage |
get_region(self,
x,
y,
width,
height)
Retrieve a rectangular region of this image.
(Inherited from pyglet.image.AbstractImage)
|
save(self,
filename=None,
file=None,
encoder=None)
Save this image to a file.
(Inherited from pyglet.image.AbstractImage)
|
ImageData |
image_data
An ImageData view of this image.
(Inherited from pyglet.image.AbstractImage)
|
Texture |
mipmapped_texture
A Texture view of this image.
(Inherited from pyglet.image.AbstractImage)
|
Texture |
texture
Get a Texture view of this image.
(Inherited from pyglet.image.AbstractImage)
|
TextureSequence |
texture_sequence
Access this image sequence as a texture sequence.
(Inherited from pyglet.image.AbstractImageSequence)
|
int |
anchor_x = 0
X coordinate of anchor, relative to left edge of image data
(Inherited from pyglet.image.AbstractImage)
|
int |
anchor_y = 0
Y coordinate of anchor, relative to bottom edge of image data
(Inherited from pyglet.image.AbstractImage)
|
int |
height
Height of image
(Inherited from pyglet.image.AbstractImage)
|
int |
width
Width of image
(Inherited from pyglet.image.AbstractImage)
|
Construct a grid for the given image.
You can specify parameters for the grid, for example setting the padding between cells. Grids are always aligned to the bottom-left corner of the image.
A Texture view of this image.
By default, textures are created with dimensions that are powers of two. Smaller images will return a TextureRegion that covers just the image portion of the larger texture. This restriction is required on older video cards, and for compressed textures, or where texture repeat modes will be used, or where mipmapping is desired.
If the rectangle
parameter is True, this restriction is ignored
and a texture the size of the image may be created if the driver
supports the GL_ARB_texture_rectangle or
GL_NV_texture_rectangle extensions. If the extensions are not
present, the image already is a texture, or the image has power 2
dimensions, the rectangle
parameter is ignored.
Examine Texture.target to determine if the returned texture is a rectangle (GL_TEXTURE_RECTANGLE_ARB or GL_TEXTURE_RECTANGLE_NV) or not (GL_TEXTURE_2D).
If the force_rectangle
parameter is True, one of these
extensions must be present, and the returned texture always
has target GL_TEXTURE_RECTANGLE_ARB or GL_TEXTURE_RECTANGLE_NV.
Changes to the returned instance may or may not be reflected in this image.
Since: pyglet 1.1
Since: pyglet 1.1
Since: pyglet 1.1
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:19 2009 | http://epydoc.sourceforge.net |